

package com.hazelcast.query.impl;

import java.util.UUID;

/**
 * TypeConverter to handle UUID
 */
final class UUIDConverter extends TypeConverters.BaseTypeConverter {

    @Override
    Comparable convertInternal(Comparable value) {
        if (value instanceof UUID) {
            return value;
        }
        if (value instanceof String string) {
            return UUID.fromString(string);
        }
        throw new IllegalArgumentException("Cannot convert [" + value + "] to java.util.UUID");
    }
}
